﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Comercio.Models.DBM;

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;


namespace Comercio.Models.proxymodel
{
    public class productoProxy
    {
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int id_producto { get; set; }

        [Required]
        [StringLength(20, ErrorMessage = "Solo se permiten 20 carácteres.")]
        public string descripcion { get; set; }
        public int id_categoria { get; set; }
        public int precio { get; set; }
        public string nombre { get; set; }
        public string imagen { get; set; }

        public IEnumerable<tb_categoria> Categoria { get; set; }

        public productoProxy(ECommerceEntities1 db)
        {
            this.Categoria = db.tb_categoria;
        }
    }
}